<%= turbo_frame_tag "archive_overlay" do %>
  <div id="overlay_toolbar">
    <div class="toolbar_buttons">
      <% if can? :create, Alchemy::Attachment %>
        <div class="toolbar_button">
          <%= render 'alchemy/admin/uploader/button',
            object: Alchemy::Attachment.new,
            dropzone: '#assign_file_list',
            file_attribute: 'file',
            in_dialog: true,
            redirect_url: admin_attachments_path(
              form_field_id: @form_field_id
            ) %>
        </div>
      <% end %>
    </div>

    <%= render 'alchemy/admin/partials/overlay_search_form' %>
  </div>

  <div
    id="assign_file_list"
    class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>"
  >
    <%= render 'library_sidebar' %>

    <div id="overlay_file_list" class="with_tag_list">
      <%= render 'overlay_file_list' %>
    </div>
  </div>
<% end %>
